package io;

import java.io.*;

public class BRDemo {
    public static void main(String[] args) {
        try (BufferedReader br = new BufferedReader(//缓冲读取字符流
                new InputStreamReader(
                        new FileInputStream(
                                "src/main/java/io/BRDemo.java")));) {
            String s;
            while ((s = br.readLine()) != null) {
                System.out.println(s);
            }
        } catch (IOException  e) {
            e.printStackTrace();
        }
        System.out.println("执行结束");

         /*br.read();
         int d;
        while ((d = br.read()) != -1) {
            System.out.print((char)d);
        }
        br.close();*/
        /*BufferedReader br = new BufferedReader(//缓冲读取字符流
                new InputStreamReader(
                        new FileInputStream(
                                "src/main/java/io/BRDemo.java")));
        int d;
        while ((d = br.read()) != -1){
            System.out.print((char) d);
        }
        br.close();*/
    }
}
